//using ThoughtWorks.CruiseControl.Core;
//using ThoughtWorks.CruiseControl.Core.Publishers.Statistics;

namespace CCStatistics.Domain.Api.Interfaces
{
    using System.Collections.Generic;

    using ThoughtWorks.CruiseControl.Core;
    using ThoughtWorks.CruiseControl.Core.Publishers.Statistics;

    /// <summary>
    /// This is an Interface which extends and wraps the CC ITask interface. We have
    /// to do this for the new Run overload.
    /// </summary>
    public interface ICCStatisticsPublisher : ITask
    {
        /// <summary>
        /// Gets the specific configured statistics, as loaded from the ccnet.config by CruiseControl.  
        /// This may include deactivated statistics (ie with Include=false).
        /// </summary>
        List<Statistic> ConfiguredStatistics { get; }

        /// <summary>
        /// Gets the active statistics.  This includes the default stats determined by <see cref="StatisticsBuilder"/>, and 
        /// any configured additons or exclusions to these contained in <see cref="ConfiguredStatistics"/>.
        /// </summary>
        List<Statistic> ActiveStatistics { get; }

        /// <summary>
        /// Different override than the standard Run method as we want to pass the logFileXml directly
        /// into the builder.ProcessBuildResults method.
        /// </summary>
        void Run(IIntegrationResult integrationResult, string logFileXml);

        /// <summary>
        /// Processes the log file.
        /// </summary>
        /// <param name="logFileName">Name of the log file.</param>
        /// <param name="statsProject">The _project.</param>
        /// <param name="nextLabel">The expected next build label, usually incremented from a previous successful build of the project.</param>
        /// <returns>Expected next label.  This mimics CruiseControl's behavior for build labels</returns>
        int ProcessLogFile(string logFileName, ICCStatsProject statsProject, int nextLabel);
    }
}